-
-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
alias command #1815
alias command #1815
Conversation
void-inject
commented
Dec 20, 2024
- Added Alias Mapping
- Added new Alias Command
- Modified triggerCommand to check alias mapping
@void-inject let me know if you need any help moving forward :) |
i am OK, will be back to home at 5th january |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1815 +/- ##
==========================================
- Coverage 95.67% 95.61% -0.07%
==========================================
Files 125 125
Lines 9950 9963 +13
==========================================
+ Hits 9520 9526 +6
- Misses 430 437 +7 ☔ View full report in Codecov by Sentry. |
5461b5e
to
5e914d1
Compare
i need help with covering lines with test |
You should be able to add a simple interaction test that input the |
Co-authored-by: Mathieu Westphal <[email protected]>
Co-authored-by: Mathieu Westphal <[email protected]>
Co-authored-by: Mathieu Westphal <[email protected]>
library/src/interactor_impl.cxx
Outdated
//------------------------------------------------------------------- | ||
private: | ||
// Map to store aliases | ||
std::map<std::string, std::string> aliasMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put that at the end of this class, next to the command map
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
library/private/interactor_impl.h
Outdated
@@ -40,6 +40,7 @@ class interactor_impl : public interactor | |||
std::string action, std::function<void(const std::vector<std::string>&)> callback) override; | |||
interactor& removeCommand(const std::string& action) override; | |||
std::vector<std::string> getCommandActions() const override; | |||
std::unordered_map<std::string, std::string> aliasMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the one in the internals instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
library/src/interactor_impl.cxx
Outdated
std::string action = tokens[0]; | ||
|
||
// Handle Alias Command | ||
if (action == "alias") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally alias
command should be yet another command add added using addCommand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think i did it correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return true; | ||
} | ||
|
||
// Resolve Alias |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless Im mistaken this should be done even before tokenizing.
is the "check" stuck? |
library/src/interactor_impl.cxx
Outdated
@@ -552,6 +547,11 @@ class interactor_impl::internals | |||
std::map<interaction_bind_t, BindingCommands> Bindings; | |||
std::multimap<std::string, interaction_bind_t> GroupedBinds; | |||
std::vector<std::string> OrderedBindGroups; | |||
//------------------------------------------------------------------- | |||
private: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed
//------------------------------------------------------------------- | ||
private: | ||
// Map to store aliases | ||
std::map<std::string, std::string> aliasMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep only this
most sad part is when you reliaze how things work after chaos |